#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 提供需求、架构文件的更新说明

import xlrd, xlwt
import sys, logging

# 
# - 完成markdown文件向excel的导入工作（根据标题，编号，自动识别是否需要编号）
# - 完成excel向markdown的更新工作
# - 完成excel向redmine的更新工作
#

def write_line(s, line, values):
    for i in range(len(values)):
        s.write(line, i, values[i]) # 写单元格：行数、列数、内容
    return line+1

def set_sheet_format(sheet, titles, widths):
    for i in range(widths):
        sheet.col(i).width = widths[i]
    line = write_line(sheet, 0, titles)
    return line

class markdown:
    def __init__(self, filename):
        pass

def format(argv):
    print(argv)

func_table=[
    'format',
]

if __name__ == '__main__':
    fun_name = sys.argv[1]
    nargs = sys.argv[2:]
    if fun_name in func_table:
        fun = getattr(self, fun_name)
        if type(fun) is types.FunctionType:
            fun(nargs)
